#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Maxn=2e5+6;
char S[Maxn],T[Maxn];
int n,m,sm[Maxn];
int dp[2010][2010],val[Maxn];
int ddp[25][Maxn];

inline bool check(int l,int r){
    if(l>r) return 1;
    return sm[r]-sm[l-1]==r-l+1 or sm[r]==sm[l-1];
}

int main(){
    freopen("seq.in","r",stdin);
    freopen("seq.out","w",stdout);
    scanf("%s%s",S+1,T+1);
    n=strlen(S+1),m=strlen(T+1);
    S[++n]='2',T[++m]='2';
    for(int i=1;i<=n;i++) sm[i]=sm[i-1]+(S[i]=='1');

    if(n<=2005){
        dp[0][0]=1;
        for(int i=1;i<=m;i++){
            if(dp[i-1][0]) val[0]=0;else val[0]=-1; 
            for(int j=1;j<=n;j++){
                val[j]=val[j-1];
                if(dp[i-1][j]) val[j]=j; 
            }   
            for(int j=1;j<=n;j++)
                if(S[j]==T[i] and val[j-1]!=-1) dp[i][j]=check(val[j-1]+1,j-1);
        }
        if(dp[m][n]){
            puts("YES");
            int j=m;
            stack<int>stk;
            for(int i=n;i;i--)
                if(dp[j][i]){
                    if(i<n) stk.push(i);
                    j--;
                }
            
            while(!stk.empty()) printf("%d ",stk.top()),stk.pop();
        }
        else puts("NO");
    }
    else if(m<=23){
        ddp[0][0]=1;
        for(int i=1;i<=m;i++){
            if(ddp[i-1][0]) val[0]=0;else val[0]=-1; 
            for(int j=1;j<=n;j++){
                val[j]=val[j-1];
                if(ddp[i-1][j]) val[j]=j; 
            }   
            for(int j=1;j<=n;j++)
                if(S[j]==T[i] and val[j-1]!=-1) ddp[i][j]=check(val[j-1]+1,j-1);
        }
        if(ddp[m][n]){
            puts("YES");
            int j=m;
            stack<int>stk;
            for(int i=n;i;i--)
                if(ddp[j][i]){
                    if(i<n) stk.push(i);
                    j--;
                }
            
            while(!stk.empty()) printf("%d ",stk.top()),stk.pop();
        }
        else puts("NO");
    }
    else{
        int j=1;
        vector<int>ans;
        for(int i=1;i<n;i++){
            if(S[i]==T[j]){
                ans.emplace_back(i);
                j++;
                if(j==m){
                    if(!check(i+1,n-1)) puts("NO");
                    else{
                        puts("YES");
                        for(auto k:ans) printf("%d ",k);
                        // system("pause");
                        return 0;
                    }
                }
            }
        }
    }

    // system("pause");
    return 0;
}
/*
0001101101
0110

00
1

11101110111011101110111
00000

000111110110001000
10101
*/